package com.ssau.expert.core.util;

import com.ssau.expert.exception.SemanticException;

/**
 * Author: Sergey Saiyan
 * Created: 19.09.13 15:16
 */
public class DataTypeHelper {

    public static Class getClassByValue(String value) throws SemanticException {

        if ("TRUE".equalsIgnoreCase(value) || "FALSE".equalsIgnoreCase(value)) {
            return Boolean.class;
        }
        try {
            Integer.valueOf(value);
            return Integer.class;
        } catch (Exception ex) {
            /* Ignore */
        }

        return String.class;
    }
}
